<?php
require_once("/home/bluecbhv/Back-End/Jcuhelpers-WebTech/Helpers/Constants.php");
require_once("/home/bluecbhv/Back-End/Jcuhelpers-WebTech/Content_Scraper/Content_Scraper.php");

/***********************************************
	This class would make a Google Custom
	Search API request.
************************************************/
class GoogleCsApiRequest extends ContentScraper {
	private $googleCsApiUrl = NULL;
	private $scrapedContent = NULL;
	
	/************************************************************/
	
	function __construct($preparedSearchKeywords) {
		$this->googleCsApiUrl = GOOGLE_CS_API_URL_PREFIX
								.$preparedSearchKeywords
								.GOOGLE_CS_API_URL_SUFFIX;
	}
	
	/************************************************************/
	
	function makeRequest($additionalParameter) {
		$csObj = new ContentScraper();
		
		if (isset($additionalParameter)) {
			$this->scrapedContent = $csObj->scrapeContent($this->googleCsApiUrl.$additionalParameter);
		} else {
			$this->scrapedContent = $csObj->scrapeContent($this->googleCsApiUrl);
		}
		return $this->scrapedContent;
	}
}
?>